import http from '../axios/axios'

// 获取所有用户列表
export function _getUserManageList () {
  return http.request({
    url: `/yuezhan/users?_expand=role`,
    method: 'get'
  })
}
// 添加用户
export function _appendUser (data) {
  data.valid = true
  return http.request({
    url: `/yuezhan/users`,
    method: 'post',
    data: data
  })
}
// 修改用户信息
export function _editUser (data) {
  return http.request({
    url: `/yuezhan/users/${data.id}`,
    method: 'patch',
    data: data.data
  })
}
// 修改用户状态
export function _patchUser (params) {
  return http.request({
    url: `/yuezhan/users/${params.id}`,
    method: 'patch',
    data: params.data
  })
}
// 删除当前用户
export function _deleteUser (params = -1) {
  return http.request({
    url: `/yuezhan/users/${params}`,
    method: 'delete'
  })
}
// 获取部门列表
export function _getRegionList () {
  return http.request({
    url: `/yuezhan/regions`,
    method: 'get'
  })
}
// 校验用户登录状态
export function _checkuser (query) {
  return http.request({
    url: '/yuezhan/users?_expand=role',
    method: 'get',
    params: query
  })
}